<?php
require_once 'Core/Form/Element/Text.php';

/**
 * Extension of the Text element class to add email validation.
 * 
 * @author Michael Krotscheck
 */

class Core_Form_Element_Email extends Core_Form_Element_Text
{
	/**
	 * Object initialization method.
	 */
	public function init()
	{
		parent::init();
		
		// Add a validator
		$this->addValidator( 'EmailAddress' );
		$this->addDecorator( 'Description', array( 'escape' => false, 'placement' => Zend_Form_Decorator_Abstract::APPEND ) );
		$this->addDecorator( 'Errors', array( 'placement' => Zend_Form_Decorator_Abstract::APPEND ) );
		$this->addFilter( 'StringTrim' );
	}
}